###
import subprocess

class MonitorProc:
	def __init__(self):
		pass

	def PipeOfProc(self, cmd):
		m = subprocess.Popen(cmd, close_fds=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
		k = m.returncode
		tmpcom = m.communicate()[0]
		if k == None: return tmpcom
		if k != 0:
			return False
		else:
			return tmpcom
	def DiskFree(self):
		cmd = 'df -m'
		return self.PipeOfProc(cmd)

	
